using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HealthBar : MonoBehaviour, IReuseable
{
    public bool CanReuse()
    {
        return !gameObject.activeSelf;
    }

    public void OnReuse(Vector3 position, Vector3 forward)
    {
        
    }

    private Transform follower;
    private Vector3 localPos;

    public void SetFollower(SelectableObject selectableObject)
    {
        follower = selectableObject.transform;
        localPos = selectableObject.hudLocalPos;
        transform.position = follower.position + localPos;
        gameObject.SetActive(true);
    }

    private void Update()
    {
        transform.position = follower.position + localPos;
    }
}
